<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/head.jsp"%>
<link rel="stylesheet" type="text/css"
	href="<%=app%>/web/base/css/managerReg.css" />
<title>管理员注册</title>
</head>
<body style="background-color: #f0f0f0;">
	<div class="window">
		<fieldset class="layui-elem-field regwindow">
			<form class="layui-form">
				<legend>注册</legend>
				<div class="layui-field-box">
					<div class="layui-form-item">
						<label class="layui-form-label">账号</label>
						<div class="layui-input-block">
							<input type="text" name="account" required lay-verify="required"
								placeholder="请输入要注册的账号" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">密码</label>
						<div class="layui-input-block">
							<input type="password" name="password" required
								lay-verify="required" placeholder="请输入密码" autocomplete="off"
								class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">确认密码</label>
						<div class="layui-input-block">
							<input type="password" name="realPassword" required
								lay-verify="required" placeholder="请再次输入密码" autocomplete="off"
								class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">昵称</label>
						<div class="layui-input-block">
							<input type="text" name="nickName" required lay-verify="required"
								placeholder="为自己起一个喜欢的名字吧" autocomplete="off"
								class="layui-input">
						</div>
					</div>
					<div id="but" class="buttonStyle">
						<div class="layui-form-item">
							<div class="layui-input-block">
								<input type="button" class="layui-btn" lay-submit
									lay-filter="reg" value="注册" style="width: 120px;" /> <input
									type="button" class="layui-btn layui-btn-primary" value="去登录"
									style="width: 120px;" onclick="goUrl('/web/login.jsp')" />
							</div>
						</div>
					</div>
				</div>
				<input type="hidden" name="action" value="reg">
			</form>
		</fieldset>
	</div>
<!-- 	分割线 --><!-- 	分割线 --><!-- 	分割线 --><!-- 	分割线 -->
<!-- 	分割线 --><!-- 	分割线 --><!-- 	分割线 --><!-- 	分割线 -->
	<script type="text/javascript">
		formOnSubmit('reg', 'text', '/ManagerServlet', function(data) {
			console.log(data)
			if (data == 'different') {
				layer.msg("两次输入的密码不一致");
			} else if (data == 'repeat') {
				layer.msg("账号已存在");
			} else if (data == '1') {
				layer.msg("注册成功",{time:1000});
				goUrl('/web/login.jsp')
			} else {
				layer.msg("未知错误");
			}
		})
	</script>
</body>
</html>